<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
	<link rel="stylesheet" type="text/css" href="Public/Home/css/head.css"/>
	<link rel="stylesheet" type="text/css" href="Public/Home/css/logo.css"/>
	<link rel="stylesheet" type="text/css" href="Public/Home/css/shop.css"/>
	<script src="Public/Home/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="Public/Home/js/shop.js" type="text/javascript" charset="utf-8"></script>
</head>
{{include file='VIEW_PATH/Common/head.php'}}
	<!--公用头部做完了-->
	<div id="ad_banner">
		<a href=""><img src="Public/Home/img/lhh.jpg"/></a>
	</div>
	<!--中间-->
	<div id="AllWrap">
		<div class="Navigation">
			您当前位置：
			<span>
				<a href="">首页</a>
			</span>
			<span>»</span>
			<span>
				<a href="">男装</a>
			</span>
			<span>»</span>
			<span>
				<a href="">T恤</a>
			</span>
			<span>»</span>
			<span>Kappa男短袖T恤 圆领图案衫半袖运动上衣2016春夏新款|K0612TD34</span>
		</div>

		<div class="goods_viewer">
			<div class="detail_inner">
				{{foreach from='$GoodsOldData' key='$k' value='$v'}}
				<div class="main_info">
					<form method="post">
						<div class="goods_leftbox" thumb="{{$v['thumb']}}">
							<a href=""><img src="{{$v['thumb']}}"/></a>
						</div>
						<div class="goods_rightbox">
							<h2 class="goodsname" sid="{{$v['sid']}}">{{$v['sname']}}</h2>
							<div class="list_clearfix">
								<ul>
									{{foreach from="$v['attr']" key='$ke' value='$va'}}
									<li>
										<span>{{$va['xname']}}：</span>
										{{foreach from="$va['xvalue']" key='$key' value="$val"}}
										<em>{{$val['shopvalue']}} </em>
										{{endforeach}}
									</li>
									{{endforeach}}
									<!--<li>
										<span>价位区间：</span>
										<em>100-199   </em>
									</li>
									<li>
										<span>材质：</span>
										<em>纯棉</em>
									</li>-->
								</ul>
							</div>
							{{foreach from="$v['spec']" key="$ke" value="$va"}}
							<div class="goods_spec">
								<label for="">
									<span>
										<em>{{$va['xname']}}：</em>
									</span>
								</label>
								<div class="rightdiv">
									<ul>
										{{foreach from="$va['xvalue']" key="$key" value="$val"}}
										<li mashu="{{$val['shopvalue']}}" oid="{{$val['oid']}}">
											<a href="javascript:;">
												<span>
													<nobr>{{$val['shopvalue']}}</nobr>
												</span>
												<i></i>
											</a>
										</li>
										{{endforeach}}
									</ul>
								</div>
							</div>
								{{endforeach}}
							<!--<div class="chose_color">
								<label for="">可选颜色：</label>
								<div class="rightdiv">
									<ul>
										<li>
											<a href=""><img src="Public/Home/img/shop001_01.jpg"/></a>
										</li>
										<li>
											<a href=""><img src="Public/Home/img/shop001_02.jpg"/></a>
											
										</li>
										<li>
											<a href=""><img src="Public/Home/img/shop001_03.jpg"/></a>
											
										</li>
									</ul>
								</div>
							</div>-->
							
							<div class="buyinfo">
								<label for="">数量：</label>
								<div class="Numinput">
									<input type="text" name="shuliang" id="shul" value="1" />
									<div class="numadjust_arr">
										<span class="increase"></span>
										<span class="decrease"></span>
									</div>
								</div>
								<span>( 库存 <em class="stock"></em> )</span>
								<script type="text/javascript">
									$(function(){
										$(".rightdiv ul li").click(function(){
													if($(".selected").length>=2){
//														alert($(".selected").length);
													var c = "";
													$.each($(".selected"), function(k,v) {
														c += $(this).attr('oid') + ",";
													});
														
														$.ajax({
															type:"post",
															url:"{{U('combine')}}",
															data:{shuzu:c},
															dataType:"json",
															success:function(data){
																if(data!=0){
																	$(".stock").html(data)
																}else{
																	$(".stock").html(data)
																}
															}
														});
													};
										})
									})
								</script>
							</div>
							<div class="mrk_price">
								<span>价格：</span>
								<em class="goodsprice">{{$v['sale']}}</em>
							</div>
							
							<div class="hightline ">
								<div class="flt">
									{{if value="isset($_SESSION['yid'])"}}
									<input type="button" name="" class="btn_fastbuy jinru" value="立即购买" style="cursor: not-allowed;" />
									{{else}}
									<input onclick="location.href='logo.html'"class="btn_fastbuy" style="cursor: not-allowed;" />
									{{endif}}
									<input type="button"  name="" class="btn_buy" value="加入购物车" style="cursor: not-allowed;" />
									<script type="text/javascript">
									//异步处理购物车
										$(function(){
											$(".btn_buy").click(function(){
												if($(".selected").length>=2){
												var li = $(".stock").html();
												if(li==0){
													alert('商品缺货');
													return;
												}
													var c = "";
														c += $(".goodsname").attr('sid') + ",";
														c += $(".goodsname").html() + ",";
														c += $(".goods_leftbox").attr('thumb') + ",";
													$.each($(".selected"),function(k,v){
														c += $(this).attr('mashu') + ",";
													})
														c += $('#shul').val()+ ",";
														c += $(".goodsprice").html();
													//发异步
													$.ajax({
														type:"post",
														url:"{{U('addajax',array('id'=>'1'))}}",
														data:{shuzu:c},
														dataType:"json",
														success:function(data){
															if(data == 1){
																location.href="cart.html";
															}
														}
													});
												}else{
													alert("请选择规格")
												}
											
											})
										})
									</script>
									<script type="text/javascript">
									//异步处理购物车
										$(function(){
											$(".jinru").click(function(){
												if($(".selected").length>=2){
													var c = "";
														c += $(".goodsname").attr('sid') + ",";
														c += $(".goodsname").html() + ",";
														c += $(".goods_leftbox").attr('thumb') + ",";
													$.each($(".selected"),function(k,v){
														c += $(this).attr('mashu') + ",";
													})
														c += $('#shul').val()+ ",";
														c += $(".goodsprice").html();
													//发异步
													$.ajax({
														type:"post",
														url:"{{U('addajax',array('id'=>'2'))}}",
														data:{shuzu:c},
														dataType:"json",
														success:function(data){
															if(data == 1){
																location.href="checkout.html";
															}
														}
													});
												}else{
													alert("请选择规格")
												}
											
											})
										})
									</script>
									<div class="pro_fav">
										<ul>
											<li>
												<a class="btn_a" href="">
													<span>
														<i></i>
														<div class="fav">收藏此商品</div>
														<div class="nofav">已收藏</div>
													</span>
												</a>
											</li>
										</ul>
									</div>
								</div>
							</div>
							<div class="numwrap">
								<p>已有 <em>26</em> 人收藏</p>
								<p>已卖出 <em>15</em> 件</p>
							</div>
						</div>
					</form>
				</div>
				{{endforeach}}
				<div class="clearfix">
					{{include file='VIEW_PATH/Common/fenlei.php'}}
					<div class="detail_right">
						<h4 class="clearfix ">
							<span class="goodsDetailTab">
								<a>商品详情</a>
							</span>
							<span class="goodsDetailTab active">
								<a>
									商品咨询(
									<em>0</em>
									)
								</a>
							</span>
						</h4>
						<div class="goodsDetailContent">
							<div class="pdtdetail" style="margin: 0;">
								<div>
									{{foreach from="$Bigthumb" key='$k' value='$v'}}
									<img src="{{$v}}"/>
									{{endforeach}}
								</div>
							</div>
							<div class="pdtdetail" style=" display: none;">
								<div class="referbox">
									<h4 class="dis_cons_title">发表咨询</h4>
									<div class="consult">
										<form method="post">
											<div class="division ">
												<div class="leftbox">
													<ul>
														<li class="ask_float">
															<span class="area_name">内容：</span>
															<span>
																 请<a href="">登录</a>后再留言
																<br />
																如果你不是会员请
																<a href="">注册!</a>
															</span>
															<textarea name="commot" style="width: 87%;" rows="" cols=""></textarea>
														</li>
														<li>
															联系方式：
															<input type="text" name="contact" vtype="required" class="inputstyle" value=" " />
															<span class="infotips">(可以是电话、email、qq等)</span>
														</li>
														<li>
															验证码：
															<input type="text" size="4" name="yanz" id="" value=" " />
															<img src=""/>
															<a href="">看不清？换张图片</a>
														</li>
														<li>
															<button class="btn" type="submit"></button>
														</li>
													</ul>
												</div>
											</div>
										</form>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>				
			</div>
		</div>
		
	</div>
	<!--底部共享區域-->
	<div id="footer">
		<div class="footer_box">
			<ul class="help_wrap">
				<li>
					<div class="TreeList">
						<div class="TreeListTitle">
							<a href="">新手指南</a>
						</div>
						<div class="TreeListContent">
							<div class="cat_1">
								<a href="">新用戶註冊</a>
							</div>
							<div class="cat_1">
								<a href="">用户协议</a>
							</div>
						</div>
					</div>
				</li>
				<li>
					<div class="TreeList">
						<div class="TreeListTitle">
							<a href="">服务相关</a>
						</div>
						<div class="TreeListContent">
							<div class="cat_1">
								<a href="">退款方式</a>
							</div>
							<div class="cat_1">
								<a href="">退换货政策</a>
							</div>
							<div class="cat_1">
								<a href="">账户管理</a>
							</div>
						</div>
					</div>
				</li>
				<li>
					<div class="TreeList">
						<div class="TreeListTitle">
							<a href="">配送服务</a>
						</div>
						<div class="TreeListContent">
							<div class="cat_1">
								<a href="">配送方式</a>
							</div>
							<div class="cat_1">
								<a href="">配送费用</a>
							</div>
							<div class="cat_1">
								<a href="">快递查询</a>
							</div>
							<div class="cat_1">
								<a href="">包装形式</a>
							</div>
						</div>
					</div>
				</li>
				<li>
					<div class="TreeList">
						<div class="TreeListTitle">
							<a href="">购物指南</a>
						</div>
						<div class="TreeListContent">
							<div class="cat_1">
								<a href="">线上购物流程</a>
							</div>
							<div class="cat_1">
								<a href="">订单质询</a>
							</div>
						</div>
					</div>
				</li>
				<li>
					<div class="TreeList">
						<div class="TreeListTitle">
							<a href="">支付方式</a>
						</div>
						<div class="TreeListContent">
							<div class="cat_1">
								<a href="">支付方式</a>
							</div>
							<div class="cat_1">
								<a href="">发票制度</a>
							</div>
						</div>
					</div>
				</li>
			</ul>
			<div class="surput_wrap">
				<ul>
					<li class="li_1">7天退换货保障</li>
					<li class="li_2">正品保障</li>
					<li class="li_3">单笔订单满99元</li>
					<li class="li_4">
						<a href="">在线客服</a>
					</li>
				</ul>
			</div>
		</div>
		<div id="ad_banner"></div>
	<div id="banquan">
		<span>©版权所有 2012 上海卡帕体育用品有限公司 备案号 京ICP备11012820号-1</span>
	</div>
	</div>
</body>
</html>
<script type="text/javascript">
								$(function(){
									//	点击物品数量的+
								//获取input的值,再加1,写入input
									$(".increase").click(function(){
										var t = $(this).parent('.numadjust_arr').prev('#shul').val();
										var l = parseInt(t)+1;
										$(this).parent('.numadjust_arr').prev('#shul').val(l);
										
									})
							
									})
								</script>
</script>
<script type="text/javascript">
								$(function(){
									//	点击物品数量的+
								//获取input的值,再加1,写入input
									$(".decrease").click(function(){
										var t = $(this).parent('.numadjust_arr').prev('#shul').val();
										var l = parseInt(t)-1;
										if(l>0){
										$(this).parent('.numadjust_arr').prev('#shul').val(l);
										}
										
									})
							
									})
								</script>
</script>
								